Skip to content

UI: Add comprehensive domain deletion confirmation dialog (Feature Request #11497)#12380

Merged
DaanHoogland merged 4 commits intoapache:4.20from
Imvedansh:Domain-Ui-4.19
Feb 5, 2026
Merged

UI: Add comprehensive domain deletion confirmation dialog (Feature Request #11497)#12380
DaanHoogland merged 4 commits intoapache:4.20from
Imvedansh:Domain-Ui-4.19

Conversation

@Imvedansh
Copy link
Contributor

@Imvedansh Imvedansh commented Jan 6, 2026

Implements a confirmation modal for domain deletion that shows detailed impact before proceeding, making it consistent with account deletion

Description

This PR implements a comprehensive domain deletion confirmation dialog, making the domain deletion process consistent with account deletion and providing better warnings to users about the impact of their actions.

Fixes #11497

New Component: DomainDeleteConfirm

  • Created a modal component that shows detailed impact before domain deletion
  • Displays a table with account-wise VM statistics:
    • Account name
    • Total VMs
    • Running VMs
    • Stopped VMs
  • Shows prominent warning about permanent deletion of accounts and VMs
  • Requires user to type the exact domain name to enable deletion
  • Fetches live data using listAccounts and listVirtualMachines APIs

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Screenshot from 2026-01-05 22-34-21 Screenshot from 2026-01-05 22-34-31

How Has This Been Tested?

  1. Navigate to Domains section
  2. Select a domain with multiple accounts and VMs
  3. Click "Delete Domain" action
  4. Verify modal shows:
    • Warning message about permanent deletion
    • Table with accurate account and VM counts
    • Confirmation input field
  5. Try clicking "Delete Domain" without typing name → button should be disabled
  6. Type incorrect domain name → button should remain disabled
  7. Type correct domain name → button should enable
  8. Click "Delete Domain" → domain should be deleted and UI should update

How did you try to break this feature and the system with this change?

  • Domain with no accounts
  • Domain with accounts but no VMs
  • Domain with mix of running and stopped VMs
  • Deleting domain while viewing it (should navigate away)
  • Whitespace handling in domain name input

@Imvedansh
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

@Imvedansh a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12380 (QA-JID-838)

@Imvedansh
Copy link
Contributor Author

@DaanHoogland WDYT?

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@DaanHoogland DaanHoogland changed the base branch from 4.19 to 4.20 January 6, 2026 15:10
@DaanHoogland
Copy link
Contributor

@Imvedansh , I moved it to 4.20 as this is the oldest supported LTS.

@DaanHoogland
Copy link
Contributor

@blueorangutan ui

@blueorangutan
Copy link

@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.26%. Comparing base (6a324da) to head (079db58).
⚠️ Report is 69 commits behind head on 4.20.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #12380      +/-   ##
============================================
+ Coverage     16.23%   16.26%   +0.02%     
- Complexity    13382    13424      +42     
============================================
  Files          5657     5661       +4     
  Lines        498999   499996     +997     
  Branches      60566    60711     +145     
============================================
+ Hits          81035    81302     +267     
- Misses       408928   409623     +695     
- Partials       9036     9071      +35     
Flag Coverage Δ
uitests 4.15% <ø> (+0.12%) ⬆️
unittests 17.11% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12380 (QA-JID-839)

@Imvedansh
Copy link
Contributor Author

@DaanHoogland WDYT?

I was working on

@Imvedansh , I moved it to 4.20 as this is the oldest supported LTS.

Yeah , was thinking same.
I was thinking of 4.22 or for now 4.20 is fine?

@Imvedansh Imvedansh requested a review from DaanHoogland January 6, 2026 15:58
Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need update for async deleteDomain (try deleting a domain which has an account)

confirmDeleteDomain () {
const params = { id: this.deleteDomainResource.id }

api('deleteDomain', params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Imvedansh deleteDomain is an async API. You would mostly always get a 200 response as it would return the jobid. So you'll have to poll that job ID instead showing success immediately

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, alrightyy.
I ll shoot changes shortly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification @shwstppr
I’ve updated the UI to treat deleteDomain as an async API by polling the returned jobId using the existing $pollJob helper, consistent with other async actions in the UI.
Success and failure are now shown only after the async job completes.
WDYS?

@abh1sar abh1sar added this to the 4.20.3 milestone Jan 7, 2026
@DaanHoogland DaanHoogland linked an issue Jan 13, 2026 that may be closed by this pull request
Implements a confirmation modal for domain deletion that shows detailed
impact before proceeding, making it consistent with account deletion
@DaanHoogland
Copy link
Contributor

@blueorangutan ui

@blueorangutan
Copy link

@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12380 (QA-JID-845)

@DaanHoogland
Copy link
Contributor

looks nice but one issue:
Screenshot 2026-01-13 at 20 15 15
I think you mean to delete users with the domain, don’t you?

deleting an empty domain works.

@Imvedansh
Copy link
Contributor Author

Imvedansh commented Jan 14, 2026

looks nice but one issue: Screenshot 2026-01-13 at 20 15 15 I think you mean to delete users with the domain, don’t you?

deleting an empty domain works.

Thanks Daan for checking this out
Let me clarify it ,I spend quite time to understand the architecture last when picked it.

Deleting an empty domain works as expected. When a domain contains accounts, users, or sub-domains, the deletion fails because the CloudStack backend does not allow cascading deletion of users or accounts during domain deletion, in order to avoid catastrophic actions. The error shown is therefore correct and comes from the backend async job result.

The UI change in this PR does not attempt to change backend deletion semantics. Instead, it focuses on:

Correctly handling deleteDomain as an async job .

Improving user awareness by clearly showing associated accounts and instances before attempting deletion

Providing better verbiage around domain deletion expectations, as requested in #11497

Previously, after an unsuccessful domain deletion, users had to manually navigate through accounts and instances to identify what was still associated with the domain, quite not cool
Screenshot 2026-01-14 092054

With the current change, the UI presents the list of associated accounts and active/stopped instances upfront, making it easier to clean up the domain by deleting the related accounts first and then retrying the domain deletion.

So far this is my understanding ,
If I'm mistaken anywhere do let me know I ll be happy to work on that

@DaanHoogland
Copy link
Contributor

Ok @Imvedansh , I do not care either way, but as https://cloudstack.staged.apache.org/api/apidocs-4.22/apis/deleteDomain.html states there is a cleanup option on the deleteDomain API and I kind of expected that to be used once I had ok’d the consequences. I am fine with merging like this even when this improvement can be done.

@Imvedansh
Copy link
Contributor Author

Ok @Imvedansh , I do not care either way, but as https://cloudstack.staged.apache.org/api/apidocs-4.22/apis/deleteDomain.html states there is a cleanup option on the deleteDomain API and I kind of expected that to be used once I had ok’d the consequences. I am fine with merging like this even when this improvement can be done.

Ok @Imvedansh , I do not care either way, but as https://cloudstack.staged.apache.org/api/apidocs-4.22/apis/deleteDomain.html states there is a cleanup option on the deleteDomain API and I kind of expected that to be used once I had ok’d the consequences. I am fine with merging like this even when this improvement can be done.

Gotcha,
I actually didn't used the state ,Let me try it
Thanks

@Imvedansh
Copy link
Contributor Author

Ok @Imvedansh , I do not care either way, but as https://cloudstack.staged.apache.org/api/apidocs-4.22/apis/deleteDomain.html states there is a cleanup option on the deleteDomain API and I kind of expected that to be used once I had ok’d the consequences. I am fine with merging like this even when this improvement can be done.

Just need to add cleanup:true in domainDelete funtion.
It's not much, but may need to be tested seprately for every state ,such as with account, with instance , state :stopped,state:running.
What would you prefer to merge this as in condition , and I can add another PR shortly for same with proper testing. or to do all in this PR
PS. Im working on what you asked as well

@shwstppr
Copy link
Contributor

Delete dialog needs cleanup options.

@Imvedansh I don't think you need to check if all resources are actually cleaned up. That is an existing flag and you just need to make sure API is called with the correct value.

cc @DaanHoogland

@DaanHoogland
Copy link
Contributor

@Imvedansh , can you look at @RosiKyu ’s last test case?

@Imvedansh
Copy link
Contributor Author

Imvedansh commented Jan 29, 2026

@RosiKyu Thanks,I really appreciate your efforts,Detailed insights

@Imvedansh
Copy link
Contributor Author

@Imvedansh , can you look at @RosiKyu ’s last test case?

Yeah,I was aware of expected behavior before hand,Working on the fixes.

@DaanHoogland
Copy link
Contributor

Working on the fixes.

thanks

Deletion message which shows actual behavior
@Imvedansh
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

@Imvedansh a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12380 (QA-JID-867)

@Imvedansh
Copy link
Contributor Author

Recording.2026-01-31.123039.1.mp4

@DaanHoogland
Copy link
Contributor

@RosiKyu can you have another look?

@DaanHoogland DaanHoogland dismissed shwstppr’s stale review February 1, 2026 14:35

as discussed in #12380 (comment) and in the issue.

import { api } from '@/api'

export default {
name: 'DomainDeleteConfirm',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Imvedansh Can have this as a generic vue component for delete confirmation of other resources as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this PR,I've kept the component domain-specific,
If a similar requirement comes up for other resources in future,I'd be cool to refactor it into reusable component and follow up with separate PR. WDYT?
Quite a catch

@RosiKyu
Copy link
Collaborator

RosiKyu commented Feb 2, 2026

@blueorangutan package

@blueorangutan
Copy link

@RosiKyu a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16679

@RosiKyu RosiKyu assigned RosiKyu and unassigned borisstoyanov Feb 5, 2026
Copy link
Collaborator

@RosiKyu RosiKyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The previously identified issues have been addressed. Functionality is solid. Great work, @Imvedansh!

Verified Fix

The navigation bug from TC6 has been addressed. Additionally, the warning message verbiage has been updated.

What Was Tested

Check Result
Delete domain while viewing it → UI navigates away PASS
Updated warning text displays correctly PASS
Exact name validation (similar names don't match) PASS
Cancel button works (no unintended deletion) PASS
Basic domain deletion still works PASS

Observations

  1. Navigation fix confirmed - After deleting a domain while viewing it, the UI now properly navigates away (no more stale data in detail panel)
  2. Warning text improved - Now reads: "All associated accounts, users, VMs, and sub-domains will be permanently deleted. This action cannot be undone." - much clearer than the previous version
  3. Exact name validation - Tested with similarly named domains (NavigationTest, NavigationTest1, NavigationTest2). Typing a partial or similar name does NOT enable the delete button. Only the exact domain name activates deletion.
  4. No regressions found
Screencast.from.2026-02-05.12-33-27.webm

Test Cases Execution Summary:

Test Results

Test Case Description Result
TC1 Delete empty domain PASS
TC2 Delete domain with account (no VMs) PASS
TC3 Delete domain with mixed VM states PASS
TC4 Cascading deletion (parent with children) PASS
TC5 Mass delete (rapid succession) PASS
TC6 Whitespace handling + navigation PASS

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@DaanHoogland DaanHoogland merged commit 3d7d412 into apache:4.20 Feb 5, 2026
26 checks passed
@Imvedansh
Copy link
Contributor Author

@RosiKyu @shwstppr Appreciate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: Make Domain Deletion Consistent with Account Deletion

8 participants